if (monitor !== Main.layoutManager.primaryIndex)
return;
+ if (this._dragFocus) {
+ this._dragFocus.cancelActions();
+ this._dragFocus = null;
+ }
+
const adjustment = this._adjustment;
adjustment.remove_transition('value');
};
DND.addDragMonitor(this._dragMonitor);
this._slideSidePages(SidePages.PREVIOUS | SidePages.NEXT | SidePages.DND);
+ this._dragFocus = null;
+ this._swipeTracker.enabled = false;
}
_onDragMotion(dragEvent) {
this._resetOvershoot();
this._slideSidePages(SidePages.NONE);
delete this._dropPage;
+ this._swipeTracker.enabled = true;
}
_onDragCancelled() {
// will move all items to their original positions
this._redisplay();
this._slideSidePages(SidePages.NONE);
+ this._swipeTracker.enabled = true;
}
_canAccept(source) {
});
}
}
+
+ updateDragFocus(dragFocus) {
+ this._dragFocus = dragFocus;
+ }
});
var PageManager = GObject.registerClass({
global.settings.is_writable('app-picker-layout');
this._placeholder = new AppIcon(app, { isDraggable });
+ this._placeholder.connect('notify::pressed', () => {
+ if (this._placeholder.pressed)
+ this.updateDragFocus(this._placeholder);
+ });
this._placeholder.scaleAndFade();
this._redisplay();
}
this._redisplay();
this._savePages();
});
+ icon.connect('notify::pressed', () => {
+ if (icon.pressed)
+ this.updateDragFocus(icon);
+ });
}
// Don't try to display empty folders
let app = appSys.lookup_app(appId);
icon = new AppIcon(app, { isDraggable });
+ icon.connect('notify::pressed', () => {
+ if (icon.pressed)
+ this.updateDragFocus(icon);
+ });
}
appIcons.push(icon);
this._delegate = this;
if (isDraggable) {
- this._draggable = DND.makeDraggable(this);
+ this._draggable = DND.makeDraggable(this, { timeoutThreshold: 200 });
+
this._draggable.connect('drag-begin', this._onDragBegin.bind(this));
this._draggable.connect('drag-cancelled', this._onDragCancelled.bind(this));
this._draggable.connect('drag-end', this._onDragEnd.bind(this));
return true;
}
+ cancelActions() {
+ if (this._draggable)
+ this._draggable.fakeRelease();
+ this.fake_release();
+ }
+
get id() {
return this._id;
}
}
_onDragBegin() {
+ if (this._menu)
+ this._menu.close(true);
this._removeMenuTimeout();
super._onDragBegin();
}
this._removeMenuTimeout();
this.fake_release();
- if (this._draggable)
- this._draggable.fakeRelease();
-
if (!this._menu) {
this._menu = new AppIconMenu(this, side);
this._menu.connect('activate-window', (menu, window) => {
return view.createFolder(apps);
}
+
+ cancelActions() {
+ if (this._menu)
+ this._menu.close(true);
+ this._removeMenuTimeout();
+ super.cancelActions();
+ }
});
var AppIconMenu = class AppIconMenu extends PopupMenu.PopupMenu {